/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生成器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using VOL.Entity.SystemModels;

namespace VOL.Entity.DomainModels
{
    [SugarTable("salesreturnordermodel", TableDescription = "销售退货单主表")]
    [Entity(TableCnName = "销售退货单主表", TableName = "salesreturnordermodel")]
    public partial class SalesReturnOrderModel : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        [Key]
        [Display(Name = "主键")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public long Id { get; set; }

        /// <summary>
        /// 退货单号
        /// </summary>
        [SugarColumn(ColumnName = "orderCode")]
        [Display(Name = "退货单号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string orderCode { get; set; }

        /// <summary>
        /// 销售单号（销售订单明细表）
        /// </summary>
        [SugarColumn(ColumnName = " salesOrderItemCode")]
        [Display(Name = "销售单号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string salesOrderItemCode { get; set; }

        /// <summary>
        /// 退货日期
        /// </summary>
        [SugarColumn(ColumnName = "returnDate")]
        [Display(Name = "退货日期")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? returnDate { get; set; }

        /// <summary>
        /// 供应商
        /// </summary>
        [SugarColumn(ColumnName = "supplierId")]
        [Display(Name = "供应商")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? supplierId { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [SugarColumn(ColumnName = "contact")]
        [Display(Name = "联系人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string contact { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [SugarColumn(ColumnName = "contactPhone")]
        [Display(Name = "联系方式")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string contactPhone { get; set; }

        /// <summary>
        /// 进货部门 ID
        /// </summary>
        [SugarColumn(ColumnName = "deptId")]
        [Display(Name = "进货部门ID")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string deptId { get; set; }

        /// <summary>
        /// 进货人 ID
        /// </summary>
        [SugarColumn(ColumnName = "userId")]
        [Display(Name = "进货人ID")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? userId { get; set; }

        /// <summary>
        /// 退货原因
        /// </summary>
        [SugarColumn(ColumnName = "returnReason")]
        [Display(Name = "退货原因")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string returnReason { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnName = "remark")]
        [Display(Name = "备注")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string remark { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        [SugarColumn(ColumnName = "status")]
        [Display(Name = "单据状态")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? status { get; set; }

        /// <summary>
        /// 审核人（单据审核后赋值）
        /// </summary>
        [SugarColumn(ColumnName = "auditor")]
        [Display(Name = "审核人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string auditor { get; set; }

        /// <summary>
        /// 审核时间（单据审核后赋值）
        /// </summary>
        [SugarColumn(ColumnName = "auditTime")]
        [Display(Name = "审核时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? auditTime { get; set; }

        /// <summary>
        /// 逻辑删除标识（0-未删除，1-已删除）
        /// </summary>
        [SugarColumn(ColumnName = "isDel")]
        [Display(Name = "逻辑删除标识")]
        [Column(TypeName = "tinyint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public sbyte isDel { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "createTime")]
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime? createTime { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "创建人ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? creator { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        [SugarColumn(ColumnName = "Modifier")]
        [Display(Name = "最后修改人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string modifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(ColumnName = "ModifyDate")]
        [Display(Name = "最后修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? modifyDate { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [SugarColumn(ColumnName = "customerName")]
        [Display(Name = "客户名称")]
        [Column(TypeName = "varchar(255)")]
        [MaxLength(255)]
        [Editable(true)]
        public string customerName { get; set; }

        /// <summary>
        /// 退货数量（从明细表计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "退货数量")]
        public int? totalQuantity { get; set; }

        /// <summary>
        /// 退货金额（从明细表计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "退货金额")]
        public decimal? totalAmount { get; set; }

        /// <summary>
        /// 退货货品（从明细表汇总）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "退货货品")]
        public string returnGoods { get; set; }

        /// <summary>
        /// 供应商名称（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "供应商名称")]
        public string supplierName { get; set; }

        /// <summary>
        /// 进货人姓名（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "进货人姓名")]
        public string userName { get; set; }

        /// <summary>
        /// 进货部门名称（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "进货部门名称")]
        public string deptName { get; set; }

        /// <summary>
        /// 单据状态名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "单据状态名称")]
        public string statusName { get; set; }

        /// <summary>
        /// 创建人姓名（数据库未存储，作为扩展字段保留）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "创建人姓名")]
        public string creatorName { get; set; }
    }
}
